#include <bits/stdc++.h>
#include <string>
using namespace std;


int main()
{
	int n,m=1;
	cin >> n;
	// a: 1角钱  b: 2角钱  c: 5角钱
    for(int c=0;c<=n/5;c++){
      for(int b=0;b<=(n-c*5)/2;b++){
		int a = n-c*5-b*2;
		if(a+b*2+c*5==n){
			// cout << a << " " << b << " " << c << endl;
			printf("%03d%12d%12d%12d\n",m++,a,b,c);
		}
	  }
	}
	
	return 0;
}
